home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / man / cat.n / menubar.n < prev    next >
Text File  |  1995-07-25  |  9KB  |  199 lines

  1.  
  2.  
  3.  
  4.      ttttkkkk____mmmmeeeennnnuuuuBBBBaaaarrrr((((nnnn))))                TTTTkkkk (((( ))))                 ttttkkkk____mmmmeeeennnnuuuuBBBBaaaarrrr((((nnnn))))
  5.  
  6.  
  7.  
  8.      _________________________________________________________________
  9.  
  10.      NNNNAAAAMMMMEEEE
  11.           tk_menuBar, tk_bindForTraversal - Support for menu bars
  12.  
  13.      SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  14.           ttttkkkk____mmmmeeeennnnuuuuBBBBaaaarrrr _f_r_a_m_e ?_m_e_n_u _m_e_n_u ...?
  15.  
  16.           ttttkkkk____bbbbiiiinnnnddddFFFFoooorrrrTTTTrrrraaaavvvveeeerrrrssssaaaallll _a_r_g _a_r_g ...
  17.      _________________________________________________________________
  18.  
  19.  
  20.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  21.           These two commands are  Tcl  procedures  in  the  Tk  script
  22.           library.  They provide support for menu bars.  A menu bar is
  23.           a frame that contains a collection of menu buttons that work
  24.           together, so that the user can scan from one menu to another
  25.           with the mouse: if the mouse  button  is  pressed  over  one
  26.           menubutton  (causing  it  to post its menu) and the mouse is
  27.           moved over another menubutton in the same menu  bar  without
  28.           releasing  the  mouse  button,  then  the  menu of the first
  29.           menubutton is unposted and the menu of the new menubutton is
  30.           posted  instead.   Menus  in a menu bar can also be accessed
  31.           using keyboard traversal (i.e.  by typing keystrokes instead
  32.           of  using  the  mouse).   In order for an application to use
  33.           these  procedures,  it  must  do  three  things,  which  are
  34.           described in the paragraphs below.
  35.  
  36.           First, each application  must  call  ttttkkkk____mmmmeeeennnnuuuuBBBBaaaarrrr  to  provide
  37.           information about the menubar.  The _f_r_a_m_e argument gives the
  38.           path name of  the  frame  that  contains  all  of  the  menu
  39.           buttons,  and  the _m_e_n_u arguments give path names for all of
  40.           the menu buttons associated with  the  menu  bar.   Normally
  41.           _f_r_a_m_e is the parent of each of the _m_e_n_u's.  This need not be
  42.           the case, but _f_r_a_m_e must be  an  ancestor  of  each  of  the
  43.           _m_e_n_u's  in  order for grabs to work correctly when the mouse
  44.           is used to pull down menus.  The order of the _m_e_n_u arguments
  45.           determines  the  traversal  order  for the menu buttons.  If
  46.           ttttkkkk____mmmmeeeennnnuuuuBBBBaaaarrrr is called without any _m_e_n_u arguments, it  returns
  47.           a  list containing the current menu buttons for _f_r_a_m_e, or an
  48.           empty string if _f_r_a_m_e isn't currently set up as a menu  bar.
  49.           If   ttttkkkk____mmmmeeeennnnuuuuBBBBaaaarrrr  is  called  with  a  single  _m_e_n_u  argument
  50.           consisting of an empty string, any menubar  information  for
  51.           _f_r_a_m_e  is  removed;   from  now  on  the  menu  buttons will
  52.           function independently without keyboard traversal.  Only one
  53.           menu  bar  may  be  defined  at a time within each top-level
  54.           window.
  55.  
  56.           The second thing an application must do is to  identify  the
  57.           traversal  characters  for  menu  buttons  and menu entries.
  58.           This is done  by  underlining  those  characters  using  the
  59.           ----uuuunnnnddddeeeerrrrlllliiiinnnneeee  options  for  the  widgets.   The menu traversal
  60.  
  61.  
  62.  
  63.      Page 1                                          (printed 7/23/95)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      ttttkkkk____mmmmeeeennnnuuuuBBBBaaaarrrr((((nnnn))))                TTTTkkkk (((( ))))                 ttttkkkk____mmmmeeeennnnuuuuBBBBaaaarrrr((((nnnn))))
  71.  
  72.  
  73.  
  74.           system uses this information to  traverse  the  menus  under
  75.           keyboard control (see below).
  76.  
  77.           The third thing that an application must do is to make  sure
  78.           that  the  input  focus  is always in a window that has been
  79.           configured to support menu traversal.  If the input focus is
  80.           nnnnoooonnnneeee  then  input  characters  will be discarded and no menu
  81.           traversal will be possible.  If you have no other  place  to  |
  82.           set  the  focus,  set  it to the menubar widget:  ttttkkkk____mmmmeeeennnnuuuuBBBBaaaarrrr  |
  83.           creates bindings for its  _f_r_a_m_e  argument  to  support  menu  |
  84.           traversal.                                                    |
  85.  
  86.           The Tk startup scripts configure all the Tk  widget  classes  |
  87.           with  bindings  to support menu traversal, so menu traversal  |
  88.           will be possible regardless of which widget has  the  focus.
  89.           If  your  application  defines  new  classes of widgets that
  90.           support   the   input   focus,   then   you   should    call
  91.           ttttkkkk____bbbbiiiinnnnddddFFFFoooorrrrTTTTrrrraaaavvvveeeerrrrssssaaaallll    for    each    of    these   classes.
  92.           TTTTkkkk____bbbbiiiinnnnddddFFFFoooorrrrTTTTrrrraaaavvvveeeerrrrssssaaaallll takes any number of arguments,  each  of
  93.           which  is  a widget path name or widget class name.  It sets
  94.           up bindings for all the named widgets and  classes  so  that
  95.           the  menu  traversal system will be invoked when appropriate
  96.           keystrokes are typed in those widgets or classes.
  97.  
  98.  
  99.      MMMMEEEENNNNUUUU TTTTRRRRAAAAVVVVEEEERRRRSSSSAAAALLLL BBBBIIIINNNNDDDDIIIINNNNGGGGSSSS
  100.           Once  an  application  has  made  the   three   arrangements
  101.           described  above,  menu traversal will be available.  At any
  102.           given time, the only menus available for traversal are those
  103.           associated  with  the  top-level window containing the input
  104.           focus.  Menu traversal is initiated by one of the  following
  105.           actions:
  106.  
  107.           [1]  If <F10> is typed, then the first menu  button  in  the
  108.                list  for  the top-level window is posted and the first
  109.                entry within that menu is selected.
  110.  
  111.           [2]  If <Alt-_k_e_y> is pressed, then the menu button that  has
  112.                _k_e_y as its underlined character is posted and the first
  113.                entry within that menu  is  selected.   The  comparison
  114.                between  _k_e_y and the underlined characters ignores case
  115.                differences.  If no menu button matches  _k_e_y  then  the
  116.                keystroke has no effect.
  117.  
  118.           [3]  Clicking mouse button 1 on a  menu  button  posts  that
  119.                menu and selects its first entry.
  120.  
  121.           Once a menu has been posted, the input focus is switched  to
  122.           that menu and the following actions are possible:
  123.  
  124.           [1]  Typing <ESC> or clicking mouse  button  1  outside  the
  125.                menu button or its menu will abort the menu traversal.
  126.  
  127.  
  128.  
  129.      Page 2                                          (printed 7/23/95)
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.      ttttkkkk____mmmmeeeennnnuuuuBBBBaaaarrrr((((nnnn))))                TTTTkkkk (((( ))))                 ttttkkkk____mmmmeeeennnnuuuuBBBBaaaarrrr((((nnnn))))
  137.  
  138.  
  139.  
  140.           [2]  If <Alt-_k_e_y> is pressed, then the entry in  the  posted
  141.                menu  whose  underlined  character  is  _k_e_y is invoked.
  142.                This causes the menu to be unposted, the entry's action
  143.                to  be  taken,  and  the  menu  traversal  to end.  The
  144.                comparison  between  _k_e_y  and   underlined   characters
  145.                ignores case differences.  If no menu entry matches _k_e_y
  146.                then the keystroke is ignored.
  147.  
  148.           [3]  The arrow keys may be used to move  among  entries  and
  149.                menus.   The  left and right arrow keys move circularly
  150.                among the available menus and the  up  and  down  arrow
  151.                keys  move  circularly among the entries in the current
  152.                menu.
  153.  
  154.           [4]  If <Return> is  pressed,  the  selected  entry  in  the
  155.                posted  menu  is  invoked,  which causes the menu to be
  156.                unposted, the entry's action to be taken, and the  menu
  157.                traversal to end.
  158.  
  159.           When a menu traversal completes, the input focus reverts  to
  160.           the window that contained it when the traversal started.
  161.  
  162.  
  163.      KKKKEEEEYYYYWWWWOOOORRRRDDDDSSSS
  164.           keyboard traversal, menu, menu bar, post
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.      Page 3                                          (printed 7/23/95)
  196.  
  197.  
  198.  
  199.